Considering different blockchains being isolated and the data interaction and sharing difficulties in the current rapid development process of blockchain technology, a cross-chain mechanism based on Spark blockchain was proposed. Firstly, common cross-chain technologies and current mainstream cross-chain projects were analyzed, the implementation principles of different technologies and projects were studied, and their differences, advantages and disadvantages were summarized. Then, using the blockchain architecture maned main-sub blockchain mode, the key core components such as smart contract component, transaction verification component, transaction timeout component were designed, and the four stages of cross-chain process were elaborated in detail, including transaction initiation, transaction routing, transaction verification and transaction confirmation. Finally, the feasible experiments were designed for performance test and security test, and the security was analyzed. Experimental results show that Spark blockchain has significant advantages compared to other blockchains in terms of transaction delay, throughput and spike testing. Besides, when the proportion of malicious nodes is low, the success rate of cross-chain transactions is 100%, and different sub chains can conduct cross-chain transactions safely and stably. This mechanism solves the problem of data interaction and sharing between blockchains, and provides technical reference for the design of Spark blockchain application scenarios in the next step.